A relational database management system (DBMS) allows entities to be modeled according to the relational paradigm, where entities are modeled in terms of tables with columns and rows. Each row contains a value for each column, thereby establishing a relation between the values in the columns. The related values in each of the rows are used to model entities.
For example, a relational table FRIENDS may be used to model persons who are friends. Each row in the relational table FRIENDS represents one friend. Each column of a relational table can represent a characteristic of a friend. Assume one column of the relational table FRIENDS is NAME, and another is SOCIAL SECURITY NUMBER. One row in FRIENDS contains the value of “John Doe” for the NAME column and the value of “999-99-9999” for the SOCIAL SECURITY NUMBER column.
An object-oriented DBMS allows entities to be modeled according to the object-oriented paradigm, where entities are modeled as instances of an object class. An object class is associated with one or more attributes and zero or more methods. The attributes of an object class are specified by a user. These data types include primitive data types, other object classes, or collections. Instances of an object class are known as “objects”. Each object contains values for its attributes. The values of the attributes are collectively referred to as the object's state. Each object that is an instance of a particular object class has the same attributes. The methods associated with an object (i.e. methods associated with the object class of the object) operate upon the state of an object. Methods associated with an object class are may also be referred to herein as routines.
Object-oriented DBMSs may contain object tables, which are tables that contain objects. Each object in an object table belongs to the same object class. For each attribute of the object class, an object table has a corresponding “attribute column” that holds values for the attribute. Each row of an object table holds the attribute values of an instance of the object class.
For example, an object class STUDENT may define several attributes for objects which represent students. Assume one attribute is NAME and another is SOCIAL SECURITY NUMBER. Further assume that object table UNDERGRAD contains objects belonging to Person. One column in Person corresponds to the NAME attribute, another column corresponds to the SOCIAL SECURITY NUMBER attribute. Each row in UNDERGRAD contains attribute values for one object.
An object-oriented DBMS may also contain object-relational tables. An object-relational table contains at least one object column that contains an object of a particular object class.
Object-oriented DBMSs offer many advantageous features not offered by relational databases. One such feature is the ability to create multiple object tables with identical columns without having to create, for each table, a separate set of identical definitions for the columns. For example, it may be desirable to create two tables with identical columns, each having a NAME column and a SOCIAL SECURITY NUMBER column. In object-oriented DBMSs, the creation of these tables can be achieved by defining one object class, such as Person, having the two attributes NAME and SOCIAL SECURITY NUMBER. Then two object tables, UNDERGRAD and GRAD, can be defined as tables having objects belonging to STUDENT. It is only necessary to define the attribute of STUDENT once to create any number of object tables (e.g., UNDERGRAD and GRAD) with columns that correspond to those attributes.
On the other hand, creating two tables analogous to the above two tables using a relational database requires two separately stored table definitions, each having their own separate column definitions. Each table definition has to be separately entered by a user.
Another advantage is that methods that are associated with an object class may be invoked to perform operations that operate on any object that is an instance of the object class. Thus, methods associated with object class STUDENT may invoked to perform operations upon objects in the object tables UNDERGRAD or GRAD.
Object-oriented DBMSs offer many other advantages of the object-oriented paradigm. Thus, object-oriented DBMS provide the power and simplicity of object-oriented programming to DBMS users and developers.